package co.edu.usbcali.dataaccess.dao;

import co.edu.usbcali.modelo.Empresa;

import java.math.BigDecimal;

import java.util.Date;
import java.util.List;
import java.util.Set;


/**
 * Interface for EmpresaDAO.
 *
 * @author Zathura Code Generator http://code.google.com/p/zathura
 */
public interface IEmpresaDAO {
    // property constants
    //public static final Long  CODIGOEMP = "codigoEmp";
    public static final String CODIGOEMP = "codigoEmp";

    //public static final String  DIRECCIONEMP = "direccionEmp";
    public static final String DIRECCIONEMP = "direccionEmp";

    //public static final String  EMAILEMP = "emailEmp";
    public static final String EMAILEMP = "emailEmp";

    //public static final String  NITEMP = "nitEmp";
    public static final String NITEMP = "nitEmp";

    //public static final String  NOMBREEMP = "nombreEmp";
    public static final String NOMBREEMP = "nombreEmp";

    //public static final String  TELEFONOEMP = "telefonoEmp";
    public static final String TELEFONOEMP = "telefonoEmp";

    /**
    * Perform an initial save of a previously unsaved Empresa entity. All
    * subsequent persist actions of this entity should use the #update()
    * method. This operation must be performed within the a database
    * transaction context for the entity's data to be permanently saved to the
    * persistence store, i.e., database. This method uses the
    * {@link javax.persistence.EntityManager#persist(Object) EntityManager#persist}
    * operation.
    *
    * <pre>
    * EntityManagerHelper.beginTransaction();
    * IEmpresaDAO.save(entity);
    * EntityManagerHelper.commit();
    * </pre>
    *
    * @param entity
    *            Empresa entity to persist
    * @throws RuntimeException
    *             when the operation fails
    */
    public void save(Empresa entity);

    /**
    * Delete a persistent Empresa entity. This operation must be performed
    * within the a database transaction context for the entity's data to be
    * permanently deleted from the persistence store, i.e., database. This
    * method uses the
    * {@link javax.persistence.EntityManager#remove(Object) EntityManager#delete}
    * operation.
    *
    * <pre>
    * EntityManagerHelper.beginTransaction();
    * IEmpresaDAO.delete(entity);
    * EntityManagerHelper.commit();
    * entity = null;
    * </pre>
    *
    * @param entity
    *            Empresa entity to delete
    * @throws RuntimeException
    *             when the operation fails
    */
    public void delete(Empresa entity);

    /**
    * Persist a previously saved Empresa entity and return it or a copy of it
    * to the sender. A copy of the Empresa entity parameter is returned when
    * the JPA persistence mechanism has not previously been tracking the
    * updated entity. This operation must be performed within the a database
    * transaction context for the entity's data to be permanently saved to the
    * persistence store, i.e., database. This method uses the
    * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge}
    * operation.
    *
    * <pre>
    * EntityManagerHelper.beginTransaction();
    * entity = IEmpresaDAO.update(entity);
    * EntityManagerHelper.commit();
    * </pre>
    *
    * @param entity
    *            Empresa entity to update
    * @return Empresa the persisted Empresa entity instance, may not be the
    *         same
    * @throws RuntimeException
    *             if the operation fails
    */
    public Empresa update(Empresa entity);

    public Empresa findById(Long id);

    /**
    * Find all Empresa entities with a specific property value.
    *
    * @param propertyName
    *            the name of the Empresa property to query
    * @param value
    *            the property value to match
    * @param rowStartIdxAndCount
    *            Optional int varargs. rowStartIdxAndCount[0] specifies the the
    *            row index in the query result-set to begin collecting the
    *            results. rowStartIdxAndCount[1] specifies the the maximum
    *            count of results to return.
    * @return List<Empresa> found by query
        */
    public List<Empresa> findByProperty(String propertyName, Object value,
        int... rowStartIdxAndCount);

    public List<Empresa> findByCriteria(String whereCondition);

    public List<Empresa> findByCodigoEmp(Object codigoEmp);

    public List<Empresa> findByCodigoEmp(Object codigoEmp,
        int... rowStartIdxAndCount);

    public List<Empresa> findByDireccionEmp(Object direccionEmp);

    public List<Empresa> findByDireccionEmp(Object direccionEmp,
        int... rowStartIdxAndCount);

    public List<Empresa> findByEmailEmp(Object emailEmp);

    public List<Empresa> findByEmailEmp(Object emailEmp,
        int... rowStartIdxAndCount);

    public List<Empresa> findByNitEmp(Object nitEmp);

    public List<Empresa> findByNitEmp(Object nitEmp, int... rowStartIdxAndCount);

    public List<Empresa> findByNombreEmp(Object nombreEmp);

    public List<Empresa> findByNombreEmp(Object nombreEmp,
        int... rowStartIdxAndCount);

    public List<Empresa> findByTelefonoEmp(Object telefonoEmp);

    public List<Empresa> findByTelefonoEmp(Object telefonoEmp,
        int... rowStartIdxAndCount);

    /**
    * Find all Empresa entities.
    *
    * @param rowStartIdxAndCount
    *            Optional int varargs. rowStartIdxAndCount[0] specifies the the
    *            row index in the query result-set to begin collecting the
    *            results. rowStartIdxAndCount[1] specifies the the maximum
    *            count of results to return.
    * @return List<Empresa> all Empresa entities
    */
    public List<Empresa> findAll(int... rowStartIdxAndCount);

    public List<Empresa> findPageEmpresa(String sortColumnName,
        boolean sortAscending, int startRow, int maxResults);

    public Long findTotalNumberEmpresa();
}
